package com.foreknow.springboot_demo.mapper;

import com.foreknow.springboot_demo.po.Business;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.sql.SQLException;
import java.util.List;

//@Mapper表示当前的Mapper层交给Mybatis来实现
@Mapper
public interface BusinessMapper {

    /**
     * 根据点餐分类编号查询所属商家信息
     * @return
     */
    @Select("select * from business where orderTypeId=#{orderTypeId} order by businessId")
    public List<Business> listBusinessByOrderTypeId(int orderTypeId);

    /**
     * 根据商家编号查询商家信息
     * @return
     */
    @Select("select * from business where businessId=#{businessId}")
    public Business getBusinessById(int businessId);

}
